/*
 * @Descripttion: 
 * @version: 1.0
 * @Author: 狸猫
 * @Date: 2023-10-23 09:28:12
 * @LastEditors: 狸猫
 * @LastEditTime: 2023-11-22 11:13:30
 */
import request from '@/utils/request'

// 新增楼盘
export function addEstate(data) {
  return request({
    url: '/enterprise/house/estate',
    method: 'post',
    data: data
  })
}
// 编辑楼盘
export function editEstate(data) {
  return request({
    url: '/enterprise/house/estate',
    method: 'put',
    data: data
  })
}

// 查询楼盘列表
export function listEstate(query) {
  return request({
    url: '/enterprise/house/estate/list',
    method: 'get',
    params: query
  })
}
// 查询楼盘、楼栋、单元数据集合
export function listEstateArray(query) {
  return request({
    url: '/enterprise/house/estate/level/list',
    method: 'get',
    params: query
  })
}
// 查询统计楼盘数据
export function getStatistics() {
  return request({
    url: '/enterprise/house/estate/statistics',
    method: 'get'
  })
}
// 查询统计楼栋数据
export function getBuildingStatistics() {
  return request({
    url: '/enterprise/house/building/statistics',
    method: 'get'
  })
}

// 查询楼盘详细
export function getEstate(estateId) {
  return request({
    url: '/enterprise/house/estate/' + estateId,
    method: 'get'
  })
}

// 删除楼盘
export function delEstate(estateId) {
  return request({
    url: '/enterprise/house/estate/remove/' + estateId,
    method: 'delete'
  })
}

// 查询楼栋列表
export function listBuilding(query) {
  return request({
    url: '/enterprise/house/building/list',
    method: 'get',
    params: query
  })
}

// 新增楼栋
export function addBuilding(data) {
  return request({
    url: '/enterprise/house/building',
    method: 'post',
    data: data
  })
}
// 编辑楼栋
export function editBuilding(data) {
  return request({
    url: '/enterprise/house/building',
    method: 'put',
    data: data
  })
}

// 查询楼栋详细
export function getBuilding(buildingId) {
  return request({
    url: '/enterprise/house/building/' + buildingId,
    method: 'get'
  })
}

// 删除楼栋
export function delBuilding(buildingId) {
  return request({
    url: '/enterprise/house/building/remove/' + buildingId,
    method: 'delete'
  })
}
// 删除单元
export function delUnit(id) {
  return request({
    url: '/enterprise/house/unit/' + id,
    method: 'delete'
  })
}


